cmake_minimum_required(VERSION 3.20)

project(SteelClientExample VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories("../")

# 创建示例程序可执行文件
add_executable(${PROJECT_NAME}
    SteelClientExample.cpp
)

# 设置输出目录
set_target_properties(${PROJECT_NAME} PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

# 在Windows上链接必要的库
if(WIN32)
    target_link_libraries(${PROJECT_NAME} SteelClient kernel32 user32)
endif()

# 复制DLL到输出目录（如果DLL已构建）
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
    $<TARGET_FILE:SteelClient>
    $<TARGET_FILE_DIR:${PROJECT_NAME}>
    COMMENT "复制SteelClient.dll到示例程序目录"
)
